*** README File for Chow and Levin (2023),
*** Title: "Muddying the Waters: How Perceived Foreign Interference Affects Public Opinion on Protest Movements", 
*** Forthcoming in American Political Science Review.

*** This file describes an overview of the information for replicating the data, analysis code, variables, and results. 
*** For any questions, please contact Wilfred Chow (wilfred.chow@hku.hk) or Dov Levin (dovlvn@hku.hk).


**********************************
*** LIST OF FILES              ***
**********************************

Data:
usa_main.csv: vignette experiment, US main sample.
can_main.csv: vignette experiment, Canadian main sample.
pretest_usa.csv: pretest data, US sample.
pretest_can.csv: pretest data, Canadian sample.
open_concede.csv: text data for open comments related to concede variable
open_repress.csv: text data for open comments related to repress variable

Code:
01Chow_Levin_Analsyis.do produces Figures 2, 3, and 6 in the main text.
02Chow_Levin_Appendix_Short.do produces Figures A1.1 to A1.3, A2.1, A4.1, A5.1 to A5.3 and Tables A2.1, A4.1, A5.1 to A5.9 in the appendix for the supplemental materials.
03Chow_Levin_Mediation.do produces Figures 4 in the main text and Figures A6.1 and A6.2 in the appendix.
04Chow_Levin_STM.do produces Figure 5 in the main text and Figures A7.1, A7.2, A7.3 and Tables A7.1, A7.2, and A7.3 in the appendix.
05Chow_Levin_Appendix_Long.do produces Figures A1.1 to A1.5, A2.1 to A2.2, A4.1, A5.1 to A5.4 and Tables A2.1 and A2.2a-A2.2e, Tables A5.1 to A5.10 in the extended online appendix.

**********************************
*** REPLICATION INSTRUCTIONS   ***
**********************************

We conducted all analyses in Stata 14 and in RStudio 2023.06.2 Build 561 with R 4.3.1 in Windows.

1) Extract all files into a directory on your computer. Run do or R script files and note that all files for reproducing figures, tables, etc. will extract into directory.
2) If necessary, install the following packages for Stata: coefplot, estout, tabout, grc1leg2.
3) If necessary, install the following packages for R: mediation, ggplot2, dplyr, ggrepel, stm, stminsights, and tm.
4) Run 01Chow_Levin_Analysis.do with usa_main.csv and can_main.csv to replicate Figures 2, 3, and 6.
5) Run 02Chow_Levin_Appendix_short.do with pretest_can.csv, pretest_usa.csv, usa_main.csv, and can_main.csv to replicate Figures A1.1 to A1.3, A2.1, A4.1, A5.1 to A5.3 and Tables A2.1, A4.1, A5.1 to A5.9.
6) Run 03Chow_Levin_Mediation.R with usa_main.csv and can_main.csv to produce Figure 4 in the main text and Figures A6.1 and A6.2 in the Appendix.
7) Run 04Chow_Levin_STM.R with open_concede.csv and open_repress.csv to produce Figure 5 in the main text and Figures A7.1-A7.3 and Table A7.1 in the Appendix.
8) Run 05Chow_Levin_Long.odo to generate Figures A1.1 to A1.5, A2.1 to A2.2, A4.1, A5.1 to A5.4 and Tables A2.1 and A2.2a-A2.2e, Table A4.1, Tables A5.1 to A5.10 in the extended online appendix.


*************************************
*** LIST OF VARIABLES for usa.dta ***
*************************************

*** Main Study
id = respondent id

concede = 5-pt measure on respondent agreement to concede to protesters
(1 = strongly disagree...5 = strongly agree) 

repress = 5-pt measure on respondent agreement to arrest protesters
(1 = strongly disagree...5 = strongly agree) 

intel = 3 possible intelligence treatments
(0 = no interference, 1 = 75% confidence, 2 = 100% confidence) 

intervene = binarizing intel variable by pooling 75 and 100 % confidence
(0 = no interference, 1 = interference)

pgroups = protest groups
(0 = Greenpeace, 1 = BLM, 2 = NAACP, 3 = Sierra Club)

timing = the timing of interference for protesters
(0 = no interference, 1 = before, 2 = after)

support = the type of support provided to protesters
(0 = no interference, 1 = financial, 2 = organizational training)

foreign = the identity of the interfering country
(0 = no interference, 1 = norway 2 = russia, 3 = saudi arabia)

female = respondent's most closely identified gender
(1 = female, 0 = male)

income = respondent's household income
(1 = less than 20k, 2 = 20k-40k, 3 = 40k-60k, 4 = 40k-80k, 5 = 80k-100k, 6 = 100k to 120k,
 7 = 120k-150k, 8 = 150k-200k, 9 = 200k or more)

party = respondent's partisan affiliation                         
(1 = independent, 2 = democrat, 3 = republican)

education = respondent's level of education          
(1 = less than high school, 2 = high school 3 = some college, 4 = 2-year college, 5 = 4-year college,
 6 = masters degree 7 = doctoral or professional degree)

white = respondent's racial identification as white
(0 = not white, 1 = white)

environment = a continuous measure of environmentalism using factor analysis (NEP ecological paradigm)
(-3.36 to 1.72 where higher numbers correspond with greater environmentalism)

anti_protest = a continuous measure of anti-protest attitudes using factor analysis 
(-1.83 to 1.72 where higher numbers correspond with greater anti-protest attitudes)

saudi = 5-point favorability measure of Saudi Arabia
(1 = very unfavorable...5 = very favorable)

norway = 5-point favorability measure of Norway
(1 = very unfavorable...5 = very favorable)

ven = 5-point favorability measure of Venezuela
(1 = very unfavorable...5 = very favorable)

russia = 5-point favorability measure of Russia
(1 = very unfavorable...5 = very favorable)

iran = 5-point favorability measure of Iran
(1 = very unfavorable...5 = very favorable)

cov1 = 3-pt measure on how much of a threat covid is to the health us population
(1 = a major threat, 2 = a minor threat, 3 = no threat at all)

cov2 = 3-pt  measure on how much of a threat covid is to your personal health
(1 = a major threat, 2 = a minor threat, 3 = no threat at all)

cov3 = 3-pt  measure on how much of a threat covid is to the us economy
(1 = a major threat, 2 = a minor threat, 3 = no threat at all)

cov4 = 3-pt  measure on how much of a threat covid is to your personal financial situation
(1 = a major threat, 2 = a minor threat, 3 = no threat at all)

commit= 7-pt measure on respondent view of protester commitment
(1 = not commited at all...7 = extremely committed) 

frack = 5-pt measure on respondent agreement for the US to refrain from fracking
(1 = strongly disagree...5 = strongly agree) 

damage = 5-pt measure on respondent agreement for the US to avoid building more pipelines
(1 = strongly disagree...5 = strongly agree) 

natsec = 5-pt measure on respondent agreement on energy security
(1 = strongly disagree...5 = strongly agree) 

foreign = the identity of the interfering country
(0 = no interference, 1 = norway 2 = russia, 3 = saudi arabia)
      
attention =  respondent's attention level 
(1 = high, 0 = low)

outsider = binarized in-group/out-group status of protesting group
(0 = in-group, 1 = out-group)

region  = four region location for U.S. respondents
(1 = Midwest, 2 = Northeast, 3 = South, 4 = West)

age = respondent's age (yrs) broken into ordered categories
(1 = 18-29, 2 = 30-44, 3 = 45-64, 4 = 65 and older)
               
race = respondent's race                            
(1 = black, 2 = asian, 3 = hispanic, 3 = white, 5 = other/native-american)

gov = how much can people like us affect what the government in Washington does?
(1 = none at all, 2 = a little, 3 = a moderate amount, 4 = a lot, 5 = a great deal)

nationalism = a continuous measure of patriotism using factor analysis 
(-2.82 to 1.22 where higher numbers correspond with greater patriotism)


******************************************
*** LIST OF VARIABLES for can_main.csv ***
******************************************

*** Main Study
id = respondent identification number

province = 13 provinces of canada
(1 = Alberta, 2 = British Columbia, 3 = Manitoba, 4 = New Brunswick, 5 = Newfoundland & Labrador,
 6 = Northwest Territories, 7 = Nova Scotia, 8 = Nunavut, 9 = Ontario, 10 = Prince Edward Island,
 11 = Quebec, 12 = Saskatchewan, 13 = Yukon)

concede = 5-pt measure on respondent agreement to concede to protesters
(1 = strongly disagree...5 = strongly agree) 

repress = 5-pt measure on respondent agreement to arrest protesters
(1 = strongly disagree...5 = strongly agree) 

intel = 3 possible intelligence treatments
(0 = no interference, 1 = 75% confidence, 2 = 100% confidence) 

intervene = binarizing intel variable by pooling 75 and 100 % confidence
(0 = no interference, 1 = interference)

outsider = binarized in-group/out-group status of protesting group
(0 = in-group, 1 = out-group)

timing = the timing of interference for protesters
(0 = no interference, 1 = before, 2 = after)

support = the type of support provided to protesters
(0 = no interference, 1 = financial, 2 = organizational training)

foreign = the identity of the interfering country
(0 = no interference, 1 = norway 2 = russia, 3 = saudi arabia)

commit= 7-pt measure on respondent view of protester commitment
(1 = not commited at all...7 = extremely committed) 

natsec = 5-pt measure on respondent agreement on energy security
(1 = strongly disagree...5 = strongly agree) 

frack = 5-pt measure on respondent agreement for the US to refrain from fracking
(1 = strongly disagree...5 = strongly agree) 

damage = 5-pt measure on respondent agreement for the US to avoid building more pipelines
(1 = strongly disagree...5 = strongly agree) 

pgroup = protest groups
(1 = Greenpeace, 2 = Nature Canada, 3 = Indigenous Group 1, 4 = Indigenous Group 2)

nationalism = a continuous measure of nationalism using factor analysis 
(-2.93 to 0.99 where higher numbers correspond with greater nationalism)

environment = a continuous measure of environmentalism using factor analysis (NEP ecological paradigm)
(-3.81 to 1.38 where higher numbers correspond with greater environmentalism)

anti_protest = a continuous measure of anti-protest attitudes using factor analysis 
(-2.22 to 1.76 where higher numbers correspond with greater anti-protest attitudes)

ethnocentrism= a continuous measure of ethnocentrism using factor analysis on respondent's ethnic bias
(-1.51 to 3.56 where higher numbers correspond with greater ethnocentrism

female = respondent's most closely identified gender
(1 = female, 0 = male)

income = respondent's household income
(1 = less than 30k, 2 = 30k-60k, 3 = 60k-90k, 4 = 90k-110k, 5 = 110k-150k, 6 = 150k to 200k, 7 = 200k or more)

federal = trust in federal government
(1 = none at all, 2 = not very much, 3 = quite a lot, 4 = a great deal)

cov1 = 3-pt measure on how much of a threat covid is to the health of canadian population
(1 = a major threat, 2 = a minor threat, 3 = no threat at all)

cov2 = 3-pt  measure on how much of a threat covid is to your personal health
(1 = a major threat, 2 = a minor threat, 3 = no threat at all)

cov3 = 3-pt  measure on how much of a threat covid is to the canadian economy
(1 = a major threat, 2 = a minor threat, 3 = no threat at all)

cov4 = 3-pt  measure on how much of a threat covid is to your personal financial situation
(1 = a major threat, 2 = a minor threat, 3 = no threat at all)

saudi = 5-point favorability measure of Saudi Arabia
(1 = very unfavorable...5 = very favorable)

norway = 5-point favorability measure of Norway
(1 = very unfavorable...5 = very favorable)

russia = 5-point favorability measure of Russia
(1 = very unfavorable...5 = very favorable)

iran = 5-point favorability measure of Iran
(1 = very unfavorable...5 = very favorable)

ven = 5-point favorability measure of Venezuela
(1 = very unfavorable...5 = very favorable)

age = respondent's age (yrs) broken into ordered categories
(1 = 18-29, 2 = 30-44, 3 = 45-64, 4 = 65 and older)

race = respondent's race                            
(1 = white, 2 = east asian, 3 = indigenous, 4 = black/hispanic/other, 5 = south asian)

education = respondent's level of education          
(1 = less than secondary school, 2 = completed secondary school, 3 = some college or techincal school 
 4 = vocational/technical school, 5 = bachelor's or higher)

party = respondent's partisan affiliation                         
(1 = independent/other, 2 = liberal, 3 = conservative, 4 = ndp, 5 = green)
       
attention =  respondent's attention level
(1 = high, 0 = low)

white = respondent's racial identification as white
(0 = not white, 1 = white)


*********************************************
*** LIST OF VARIABLES for pretest_usa.dta ***
*********************************************

size = selection by respondents how many persons constitutes a significant protest
(1 = 100, 2 = 200, 3 = 300, 4 = 400, 5 = 500, 6 = 700, 7 = 800, 8 = 900, 10 = 1,000, 11 = 2,000, 
 12 = 5,000, 13 = 50,000, 14 = 100,000, 15 = 500,000, 16 = 1,000,000, 17 = 2,000,000)

saudi = 5-point favorability measure of Saudi Arabia
(1 = very unfavorable...5 = very favorable)

iran = 5-point favorability measure of Iran
(1 = very unfavorable...5 = very favorable)

ven = 5-point favorability measure of Venezuela
(1 = very unfavorable...5 = very favorable)

russia = 5-point favorability measure of Russia
(1 = very unfavorable...5 = very favorable)

norway = 5-point favorability measure of Norway
(1 = very unfavorable...5 = very favorable)

plegit_fund = 5-point measure of legitimacy of interference that funds protesters
(1 = extremely illegitimate...7 = perfectly legitimate)

plegit_train = 5-point measure of legitimacy of interference that trains protesters
(1 = extremely illegitimate...7 = perfectly legitimate)

// Measures of most common race of protesting group
(1 = black, 2 = asian, 3 = white, 4 = hispanic, 5 = native american)
blm_race1 = black lives matter by most common racial/ethnic group
naacp_race1 = naacp by most common racial/ethnic group
green_race1 = greenpeace by most common racial/ethnic group
sierra_race1 = sierra club by most common racial/ethnic group
tribe_race1 = indigenous tribe 1 by most common racial/ethnic group
foe_race1 = indigenous tribe 2 by most common racial/ethnic group

// 100 point measure of respondent's perceived racial/ethnic distribution of protesting group
blm_asian = percentage of asians in blm.
blm_native = percentage of native americans in blm.
blm_white = percentage of whites in blm.
blm_black = percentage of blacks in blm.
blm_hispanic = percentage of hipanics in blm.

green_asian = percentage of asians in greenpeace.
green_native = percentage of native americans in greenpeace.
green_white = percentage of whites in greenpeace.
green_black = percentage of blacks in greenpeace.
green_hispanic = percentage of hipanics in greenpeace.

naacp_asian = percentage of asians in naacp.
naacp_native = percentage of native americans in naacp.
naacp_white = percentage of whites in naacp.
naacp_black = percentage of blacks in naacp.
naacp_hispanic = percentage of hipanics in naacp.

sierra_asian = percentage of asians in sierra club.
sierra_native = percentage of native americans in sierra club.
sierra_white = percentage of whites in sierra club.
sierra_black = percentage of blacks in sierra club.
sierra_hispanic = percentage of hipanics in sierra club.


*********************************************
*** LIST OF VARIABLES for pretest_can.csv ***
*********************************************

psize = selection by respondents how many persons constitutes a significant protest
(1 = 100, 2 = 200, 3 = 300, 4 = 400, 5 = 500, 6 = 700, 7 = 800, 8 = 900, 10 = 1,000, 11 = 2,000, 
 12 = 5,000, 13 = 50,000, 14 = 100,000, 15 = 500,000, 16 = 1,000,000, 17 = 2,000,000)

saudi = 5-point favorability measure of Saudi Arabia
(1 = very unfavorable...5 = very favorable)

iran = 5-point favorability measure of Iran
(1 = very unfavorable...5 = very favorable)

ven = 5-point favorability measure of Venezuela
(1 = very unfavorable...5 = very favorable)

russia = 5-point favorability measure of Russia
(1 = very unfavorable...5 = very favorable)

norway = 5-point favorability measure of Norway
(1 = very unfavorable...5 = very favorable)

plegit_1 = 5-point measure of legitimacy of interference that funds protesters
(1 = extremely illegitimate...7 = perfectly legitimate)

plegit_2 = 5-point measure of legitimacy of interference that trains protesters
(1 = extremely illegitimate...7 = perfectly legitimate)

// Measures of most common race of protesting group
(1 = black, 2 = asian, 3 = white, 4 = hispanic, 5 = native american)
group1_1 = indigenous group 1 by most common racial/ethnic group
group1_2 = indigenous group 3 by most common racial/ethnic group
group1_3 = greenpeace by most common racial/ethnic group
group1_4 = nature canada by most common racial/ethnic group
group1_5 = indigenous group 3 by most common racial/ethnic group
group1_6 = environmental defence canada by most common racial/ethnic group

// 100 point measure of respondent's perceived racial/ethnic distribution of protesting group
race1_1_1 = percentage of east asians in environmental defence canada.
race1_1_2 = percentage of first nations in environmental defence canada.
race1_1_3 = percentage of south asians in environmental defence canada.
race1_1_4 = percentage of whites in environmental defence canada.
race1_1_5 = percentage of blacks in environmental defence canada.

race1_2_1 = percentage of east asians in indigenous group 2.
race1_2_2 = percentage of first nations in indigenous group 2.
race1_2_3 = percentage of south asians in indigenous group 2.
race1_2_4 = percentage of whites in indigenous group 2.
race1_2_5 = percentage of blacks in indigenous group 2.

race1_3_1 = percentage of east asians in nature canada.
race1_3_2 = percentage of first nations in nature canada.
race1_3_3 = percentage of south asians in nature canada.
race1_3_4 = percentage of whites in nature canada.
race1_3_5 = percentage of blacks in nature canada.

race2_1_1 = percentage of east asians in indigenous group 1.
race2_1_2 = percentage of first nations in indigenous group 1.
race2_1_3 = percentage of south asians in indigenous group 1.
race2_1_4 = percentage of whites in indigenous group 1.
race2_1_5 = percentage of blacks in indigenous group 1.

race2_2_1 = percentage of east asians in greenpeace.
race2_2_2 = percentage of first nations in greenpeace.
race2_2_3 = percentage of south asians in greenpeace.
race2_2_4 = percentage of whites in greenpeace.
race2_2_5 = percentage of blacks in greenpeace.

race2_3_1 = percentage of east asians in indigenous group 3.
race2_3_2 = percentage of first nations in indigenous group 3.
race2_3_3 = percentage of south asians in indigenous group 3.
race2_3_4 = percentage of whites in indigenous group 3.
race2_3_5 = percentage of blacks in indigenous group 3.

**********************************************
*** LIST OF VARIABLES for open_concede.csv ***
**********************************************

natsec = 5-pt measure on respondent agreement on energy security
(1 = strongly disagree...5 = strongly agree) 

concede = 5-pt measure on respondent agreement to concede to protesters
(1 = strongly disagree...5 = strongly agree) 

intervene = binarizing intel variable by pooling 75 and 100 % confidence
(0 = no interference, 1 = interference)

commit= 7-pt measure on respondent view of protester commitment
(1 = not commited at all...7 = extremely committed) 

**********************************************
*** LIST OF VARIABLES for open_repress.csv ***
**********************************************

natsec = 5-pt measure on respondent agreement on energy security
(1 = strongly disagree...5 = strongly agree) 

repress = 5-pt measure on respondent agreement to arrest protesters
(1 = strongly disagree...5 = strongly agree) 

intervene = binarizing intel variable by pooling 75 and 100 % confidence
(0 = no interference, 1 = interference)

commit= 7-pt measure on respondent view of protester commitment
(1 = not commited at all...7 = extremely committed) 





